<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
</head>
<style>

</style>
<body>
    <table class="append">
        
    </table>
</body>
</html>

<script>
    var append = document.querySelector(".append")
    // 时间戳
    let before = new Date("2024-5-1").getTime()

    //爬取数据的数组
    let arr = ["材料学域","计算机学域","物理学域","机电学域","光学域","环境能源学域","医学生物学域","化学化工学域"]

    //获取到的数据
    let data = []
    function aync(callback){
        arr.forEach((item,index)=>{
            $.ajax({
                url:"https://www.pasanhu.cn/srv/WSPC/QKYDT?page=1&limit=10000&researchArea=" + item,
                type:"Get",
                headers:{"Access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzZWMiOiI2ODU5NzMiLCJleHAiOjYzODU2ODExMDQ3MzgyMDYzMH0_0.3FE3C5DF97A19BC4C554C14CE79D55FDC218F03343A060BC25858388BC643FCE"},
                contentType:"application/json;charset=utf-8",
                success:function(res){
                    res.data.forEach((items,indexs)=>{
                        if(parseInt(new Date(items.date).getTime())>parseInt(before)){
                            data.push("https://www.pasanhu.cn/ScientificDetailCn.aspx?id=" + items.id)
                        }
                    })
                }
            })
        })
        setTimeout(()=>{
            callback(data)
        },7000)
    }


    aync(function(e){
        e.forEach((item,index)=>{
            console.log(11)
            let str = `
                <tr>
                    <td>
                        ${item}    
                    </td>    
                </tr>
            `
            $(".append").append(str)
        })
    })
</script>